﻿namespace Devonline.Entity;

/// <summary>
/// 具有日期和时间范围的视图数据对象模型基类
/// 字符串主键的默认实现
/// </summary>
public abstract class EntitySetWithDateTimeRangeViewModel : EntitySetWithDateTimeRangeViewModel<string>, IViewModel, IEntitySet, IDateTimeRange { }

/// <summary>
/// 具有日期和时间范围的视图数据对象模型基类
/// </summary>
public abstract class EntitySetWithDateTimeRangeViewModel<TKey> : ViewModel<TKey>, IViewModel<TKey>, IEntitySet<TKey>, IDateTimeRange<TKey> where TKey : IConvertible
{
    /// <summary>
    /// 起始时间
    /// </summary>
    [DisplayName("起始时间"), Excel]
    public virtual DateTime StartOn { get; set; }
    /// <summary>
    /// 结束时间
    /// </summary>
    [DisplayName("结束时间"), Excel]
    public virtual DateTime? EndOn { get; set; }
}

/// <summary>
/// 具有日期范围的视图数据对象模型接口
/// 字符串主键的默认接口
/// </summary>
public abstract class EntitySetWithDateRangeViewModel : EntitySetWithDateRangeViewModel<string>, IViewModel, IEntitySet, IDateRange { }

/// <summary>
/// 具有日期范围的视图数据对象模型接口
/// </summary>
public abstract class EntitySetWithDateRangeViewModel<TKey> : ViewModel<TKey>, IViewModel<TKey>, IEntitySet<TKey>, IDateRange<TKey> where TKey : IConvertible
{
    /// <summary>
    /// 起始日期
    /// </summary>
    [DisplayName("起始日期"), Excel]
    public virtual DateOnly StartOn { get; set; }
    /// <summary>
    /// 结束日期
    /// </summary>
    [DisplayName("结束日期"), Excel]
    public virtual DateOnly? EndOn { get; set; }
}

/// <summary>
/// 具有时间范围的视图数据对象模型接口
/// 字符串主键的默认接口
/// </summary>
public abstract class EntitySetWithTimeRangeViewModel : EntitySetWithTimeRangeViewModel<string>, IViewModel, IEntitySet, ITimeRange { }

/// <summary>
/// 具有时间范围的视图数据对象模型接口
/// </summary>
public abstract class EntitySetWithTimeRangeViewModel<TKey> : ViewModel<TKey>, IViewModel<TKey>, IEntitySet<TKey>, ITimeRange<TKey> where TKey : IConvertible
{
    /// <summary>
    /// 起始时间
    /// </summary>
    [DisplayName("起始时间"), Excel]
    public virtual TimeOnly StartOn { get; set; }
    /// <summary>
    /// 结束时间
    /// </summary>
    [DisplayName("结束时间"), Excel]
    public virtual TimeOnly? EndOn { get; set; }
}